{* @todo @chess 2015-01-15 12:25:08 *}
<div class="circt clearfix">
  {foreach $list as $k=>$v}
    {$goods_info = _uri('goods', $v.res_id)}
    {$goods_cover = _uri('attachment', $goods_info.cover, 'path')}
    <div class="circt-box">
      <div class="circt-top clearfix">
        <h4><img src="{_image($goods_cover, 'middle')}" /></h4>
        <div class="circt-l">
          <h1 class="not-line">{$goods_info.title}</h1>
          <div class="circt-s clearfix">
            {$star = comment_helper::get_comment_star($goods_info.id)}
            {for $a=1 to 5}
              <a href="javascript:void(0);" {if $a>$star}class="check-cir"{/if}></a>
            {/for}
          </div>
        </div>
        <div class="circt-r">
          <h1>{$goods_info.price}元</h1>
          {$count_comment = comment_helper::get_count_comment($goods_info.id)}
          <h2>{$count_comment}人评价</h2>
        </div>
      </div>
      <div class="circt-delect clearfix" data-id="{$goods_info.id}">
        <a class="dele2 js_cart" href="{AnUrl("goods/{$v.res_id}")}">查看商品</a>
        <a class="dele3 js_delete" href="javascript:void(0);">取消收藏</a>
      </div>
    </div>
  {foreachelse}
    <div class="menu-all"><p>暂无收藏</p></div>
  {/foreach}
  <!--circt-box  end-->
</div>
<!--circt  end-->
<script>
$(function(){
  $('.js_delete').click(function(){
    thisBtn = $(this);
    showConfirm('确认取消收藏吗？', function(){
      var id = thisBtn.parent().data('id');
      $.post(
         '{AnUrl('fav/delete')}',
         { res_id:id, res_name:'goods' },
         function(data){
           if (data.info != 'ok') {
             showMsg('取消收藏失败', 'error');
             return false;
           }
           showMsg('取消收藏成功', 'success');
           thisBtn.parent().parent().remove()
         },
         'json'
      )
    })
  })
})
</script>
{include_core file="lib/page_fav.html"}